package com.cyzy.service.impl;

import com.cyzy.mapper.TimetableMapper;
import com.cyzy.service.TimetableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TimetableServiceImpl implements TimetableService {

    private final TimetableMapper timetableMapper;

    @Autowired
    public TimetableServiceImpl(TimetableMapper timetableMapper) {
        this.timetableMapper = timetableMapper;
    }

    @Override
    public List<Map<String, Object>> getTimetableByTeacherId(Integer teacherId) {
        if (teacherId == null || teacherId <= 0) {
            throw new IllegalArgumentException("教师ID不能为空且必须大于0");
        }
        return timetableMapper.selectTimetableByTeacherId(teacherId);
    }
}